-- Constraint: gestion_ai_padpadrel

--  Correccion de constraints, decia on delete NO ACTION - pasa a CASCADE
--  Ric 8/2021
ALTER TABLE public.padrel
    DROP CONSTRAINT gestion_ai_padpadrel;

ALTER TABLE public.padrel
    ADD CONSTRAINT gestion_ai_padpadrel FOREIGN KEY (idpad)
    REFERENCES public.pad (id) MATCH SIMPLE
    ON UPDATE NO ACTION
    ON DELETE CASCADE;
	
ALTER TABLE public.padrel
    DROP CONSTRAINT gestion_ai_padpadrel2;

ALTER TABLE public.padrel
    ADD CONSTRAINT gestion_ai_padpadrel2 FOREIGN KEY (idpadrel)
    REFERENCES public.pad (id) MATCH SIMPLE
    ON UPDATE NO ACTION
    ON DELETE CASCADE;
	

-- ==================================
   SELECT aaVersion('464.08','464.07');
-- ==================================
